<extend name="./Application/Home/View/layout.html"/>
<block name="content">
<!--Start content-->
<section class="Shop-index">
 <article>
  <div class="shopinfor">
   <div class="title">
    <img src="__HOME__upload/wpjnewlogo.jpg" class="shop-ico">
    <span>含山路外婆家</span>
    <span>
     <img src="__HOME__images/star-on.png">
     <img src="__HOME__images/star-on.png">
     <img src="__HOME__images/star-on.png">
     <img src="__HOME__images/star-on.png">
     <img src="__HOME__images/star-off.png">
    </span>
    <span>4.8</span>
   </div>
   <div class="imginfor">
    <div class="shopimg">
     <img src="__IMG__{$goods['good_img'][0]['url']}" id="showimg">
    <input type="hidden" name="" id="g_id" value="{$goods.id}" >
      <ul class="smallpic">
        <foreach name="goods['good_img']" key="k" item="v">
          <li><img src="__IMG__{$v.url}" onmouseover="show(this)" onmouseout="hide()"></li>
          </foreach>
      </ul>
    </div>
    <div class="shoptext">
     <section class="fslist_navtree">
  <ul class="select">
  <foreach name="spec" item="v">
    <li class="select-list">
      <dl id="select1">
        <dt>{$v.spec_name}</dt>
        <dd class="select-all selected"><a href="javascript:" vid="0">全部</a></dd>
        <foreach name="spec_item" item="vi">
              <if condition="$v['id'] eq $vi['spec_id']">
                <dd><a href="javascript:" vid="{$vi.id}">{$vi.name}</a></dd>
              </if>
        </foreach>
      </dl>
    </li>
    </foreach>
    <li class="select-list">
      <dl id="select1">
        <dt>价格</dt>
          <dd><span id="pirce" style="color: red; font-weight:bold ; font-size: 20px;">{$goods.shop_price}</span></dd>
      </dl>
    </li>
  </ul>
 </section>
     <div class="Button">
      <a href="#ydwm" id=""><span class="DCbutton">立即购买</span></a>
      <a href="#ydwm"><span class="DCbutton">加入购物车</span></a>
     </div>
     <div class="otherinfor">
     <a href="#" class="icoa"><img src="__HOME__images/collect.png">收藏店铺（1293）</a>
     <div class="bshare-custom"><a title="分享" class="bshare-more bshare-more-icon more-style-addthis">分享</a></div>
   <script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=1&amp;lang=zh"></script><script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
     </div>
   </div>
   </div>
  </div>
  <div class="shopcontent">
  <div class="title2 cf">
    <ul class="title-list fr cf ">
      <li class="on">菜谱</li>
      <li>累计评论（5）</li>
      <li>商家详情</li>
      <li>店铺留言</li>
      <p><b></b></p>
    </ul>
  </div>
  <div class="menutab-wrap">
   <a name="ydwm">
    <!--case1-->
    <div class="menutab show">
     <ul class="products">
    <li>
     <a href="detailsp.html" target="_blank" title="酸辣土豆丝">
         <img src="__HOME__upload/01.jpg" class="foodsimgsize">
         </a>
          <a href="#" class="item">
     <div>
      <p>酸辣土豆丝</p>
      <p class="AButton">拖至购物车:￥50.00</p>
     </div>
     </a>
    </li>
    <li>
     <a href="detailsp.html" target="_blank" title="酸辣土豆丝">
         <img src="__HOME__upload/02.jpg" class="foodsimgsize">
         </a>
          <a href="#" class="item">
     <div>
      <p>酸辣土豆丝</p>
      <p class="AButton">拖至购物车:￥50.00</p>
     </div>
     </a>
    </li>
    <li>
     <a href="detailsp.html" target="_blank" title="酸辣土豆丝">
         <img src="__HOME__upload/04.jpg" class="foodsimgsize">
         </a>
          <a href="#" class="item">
     <div>
      <p>酸辣土豆丝</p>
      <p class="AButton">拖至购物车:￥50.00</p>
     </div>
     </a>
    </li>
    <li>
     <a href="detailsp.html" target="_blank" title="酸辣土豆丝">
         <img src="__HOME__upload/03.jpg" class="foodsimgsize">
         </a>
          <a href="#" class="item">
     <div>
      <p>酸辣土豆丝</p>
      <p class="AButton">拖至购物车:￥50.00</p>
     </div>
     </a>
    </li>
       <div class="TurnPage">
     <a href="#">
      <span class="Prev"><i></i>首页</span>
     </a>
     <a href="#"><span class="PNumber">1</span></a>
     <a href="#"><span class="PNumber">2</span></a>
     <a href="#">
     <span class="Next">最后一页<i></i></span>
     </a>
    </div>
   </ul>
    </div>
    </a>
    <!--case2-->
    <div class="menutab">
     <div class="shopcomment">
      <div class="Spname">
       <a href="#" target="_blank" title="酸辣土豆丝">酸辣土豆丝</a>
      </div>
      <div class="C-content">
       <q>还不错，速度挺快,还不错，速度挺快还不错，速度挺快还不错，速度挺快还不错，速度挺快还不错，速度挺快还不错，速度挺快。。。</q>
       <i>2014年09月17日 19:36 </i>
      </div>
      <div class="username">
      DeatGhost
      </div>
     </div>
    </div>
    <!--case4-->
    <div class="menutab">
     <div class="shopdetails">
     <div class="shopmaparea">
      <img src="__HOME__upload/testimg.jpg"><!--此处占位图调用动态地图后将其删除即可-->
     </div>
     <div class="shopdetailsT">
      <p><span>店铺：外婆家</span></p>
      <p><span>地址：</span>陕西省西安市雁塔区丈八北路***号</p>
      <p><span>电话：</span>029-88888888</p>
      <p><span>乘车路线：</span>300路、115路、14路、800路到西辛庄站下车往东100米</p>
      <p><span>店铺介绍：</span>***于2005年3月28日开业，立于西安市碑林区***于2005年3月28日开业，立于西安市碑林区***于2005年3月28日开业，立于西安市碑林区***于2005年3月28日开业，立于西安市碑林区***</p>
     </div>
    </div>
    </div>
    <!--case5-->
    <div class="menutab">
     <span class="Ask"><i>DeathGhost</i>:这里是测试问答？</span>
     <span class="Answer"><i>管理员回复</i>：这里是测试回答！</span>

     <div class="TurnPage">
     <a href="#">
      <span class="Prev"><i></i>首页</span>
     </a>
     <a href="#"><span class="PNumber">1</span></a>
     <a href="#"><span class="PNumber">2</span></a>
     <a href="#">
     <span class="Next">最后一页<i></i></span>
     </a>
    </div>

     <form class="A-Message" action="#">
      <p><i>姓名：</i><input name="usr_name" type="text" autofocus placeholder="张三" required></p>
      <p><i>手机：</i><input name="" type="text" placeholder="15825518***" pattern="[0-9]{11}" required></p>
      <p><i>邮件：</i><input type="email" name="email" autocomplete="off" placeholder="admin@admin.com" required/></p>
      <p><i>问题补充：</i><textarea name="" cols="" rows="" required placeholder="详细说明您的问题..."></textarea></p>
      <p><input type="submit" class="Abutt" /></p>
     </form>
    </div>
  </div>
</div>
 </article>
 <aside>
  <div class="cart" id="Topcart">
  <span class="Ctitle Block FontW Font14"><a href="cart.html" target="_blank">我的购物车</a></span>
  <table id="cartcontent" fitColumns="true">
  <thead>
  <tr>
  <th width="33%" align="center" field="name">商品</th>
  <th width="33%" align="center" field="quantity">数量</th>
  <th width="33%" align="center" field="price">价格</th>
  </tr>
  </thead>
  </table>
  <p class="Ptc"><span class="Cbutton"><a href="cart.html" target="进入购物车">进入购物车</a></span><span class="total">共计金额: ￥0</span></p>
  </div>

  <div class="Nearshop">
   <span class="Nstitle">附近其他店铺</span>
   <ul>
    <li>
     <img src="__HOME__upload/cc.jpg">
     <p>
     <span class="shopname" title="动态调用完整标题"><a href="detailsp.html" target="_blank" title="肯德基">肯德基</a></span>
     <span class="Discolor">距离：1.2KM</span>
     <span title="完整地址title">地址：西安市雁塔区2000号...</span>
     </p>
    </li>
   </ul>
  </div>

  <div class="History">
   <span class="Htitle">浏览历史</span>
   <ul>
    <li>
    <a href="detailsp.html" target="_blank" title="清真川菜馆"><img src="__HOME__upload/cc.jpg"></a>
    <p>
     <span class="shopname" title="动态调用完整标题"><a href="detailsp.html" target="_blank" title="正宗陕北小吃城">正宗陕北小吃城</a></span>
     <span>西安市莲湖区土门十西安市莲湖区土门十字西安市莲湖区土门十字.</span>
    </p>
    </li>
    <span>[ <a href="#">清空历史记录</a> ]</span>
   </ul>
  </div>
 </aside>

</section>
<!--End content-->
</block>
<block name="js">
  <script type="text/javascript">
    $(function(){
      var len=$('.selected').length;
      var vid='0';
      var g_id=$('#g_id').val();

      $('.select dd').click(function(event) {
        var rule=g_id+'_';
        //alert($(this).length);
        /* Act on the event */
        //alert($(this).find('a').attr('vid'));
        $('.selected').each(function(i,obj){

          vid=$(obj).find('a').attr('vid');
          if(vid>0){
            rule+=vid+'_';
          }
        });

        rule=rule.substring(0,rule.length-1);
        var a= rule.split("_").length-1 ;
        var b= $('.selected').length;
        var all_pirce=0;
            if(a==b){
              $.ajax({
                    url: "{:U('Home/ajax/detail_price')}",
                    type: 'post',
                    data:{
                      'spec_rule':rule
                    },
                    success: function(e){
                      var g_p=parseInt($('#pirce').text());
                      var e_p=parseInt(e.spec_price);
                      $('#pirce').text(g_p+e_p);
                       //   all_pirce=parseInt($('#pirce').text())+parseInt(e.spec_price));
                       // alert(all_pirce);
                    }
                })
            }
          // if(rule.indexOf("_")>=rule.length-1){
          // alert("str包含a");
          // }

      });
    })
  </script>
</block>